<div class="ibox">
    <div class="ibox-title">
        <h5>
            <vc:i18n name="修改工作单" namespace="editWork"></vc:i18n>
        </h5>
        <div class="ibox-tools" style="top:10px;"></div>
    </div>
    <div class="ibox-content">
        <div class="form-group row">
            <label class="col-sm-2 col-form-label text-right">
                <vc:i18n name="标题" namespace="editWork"></vc:i18n>
            </label>
            <div class="col-sm-4">
                <input v-model.trim="editWorkInfo.workName" type="text" maxlength="20"
                    :placeholder="vc.i18n('必填，请填写标题','editWork')" class="form-control">
            </div>
            <label class="col-sm-2 col-form-label text-right">
                <vc:i18n name="工作单类型" namespace="editWork"></vc:i18n>
            </label>
            <div class="col-sm-4">
                <select class="custom-select" v-model="editWorkInfo.wtId">
                    <option selected disabled value="">
                        {{vc.i18n('必填，请选择工作单类型','editWork')}}
                    </option>
                    <option :value="item.wtId" v-for="(item,index) in editWorkInfo.workTypes">
                        {{item.typeName}}
                    </option>
                </select>
            </div>
        </div>
        <div class="form-group row">
            <label class="col-sm-2 col-form-label text-right">
                <vc:i18n name="处理人" namespace="editWork"></vc:i18n>
            </label>
            <div class="col-sm-4 flex justify-start">
                <div style="line-height: 35px;" class="margin-right" v-for="(staff,index) in editWorkInfo.staffs">
                    <span>{{staff.staffName}}</span>
                    <span class="fa fa-remove" @click="_deleteWorkStaff(staff)"></span>
                </div>
                <button class="btn btn-link " type="button" v-on:click="_chooseWorkStaff()">
                    <i class="fa fa-search"></i>选择
                </button>
            </div>
            <label class="col-sm-2 col-form-label text-right">
                <vc:i18n name="抄送人" namespace="editWork"></vc:i18n>
            </label>
            <div class="col-sm-4 flex justify-start">
                <div style="line-height: 35px;" class="margin-right" v-for="(staff,index) in editWorkInfo.copyStaffs">
                    <span>{{staff.staffName}}</span>
                    <span class="fa fa-remove" @click="_deleteCopyWorkStaff(staff)"></span>
                </div>
                <button class="btn btn-link " type="button" v-on:click="_chooseCopyWorkStaff()">
                    <i class="fa fa-search"></i>选择
                </button>
            </div>
        </div>
        <div class="form-group row">
            <label class="col-sm-2 col-form-label text-right">
                <vc:i18n name="工作单标识" namespace="editWork"></vc:i18n>
            </label>
            <div class="col-sm-4">
                <select class="custom-select" v-model="editWorkInfo.workCycle">
                    <option selected disabled value="">
                        {{vc.i18n('必填，请选择工作单标识','editWork')}}
                    </option>
                    <option value="1001">一次性工单</option>
                    <option value="2002">周期性工单</option>
                </select>
            </div>
            <label class="col-sm-2 col-form-label text-right">
                <vc:i18n name="附件" namespace="editWork"></vc:i18n>
            </label>
            <div class="col-sm-4">
                <vc:create path="frame/uploadFile" callBackListener="editWork" callBackFunction="notifyFile"
                    namespace="editWork">
                </vc:create>
            </div>
        </div>
        <div class="form-group row">
            <label class="col-sm-2 col-form-label text-right">
                <vc:i18n name="开始时间" namespace="editWork"></vc:i18n>
            </label>
            <div class="col-sm-4">
                <input v-model="editWorkInfo.startTime" type="text" :placeholder="vc.i18n('必填，请填写开始时间','editWork')"
                    class="form-control editWorkStartTime">
            </div>
            <label class="col-sm-2 col-form-label text-right">
                <vc:i18n name="结束时间" namespace="editWork"></vc:i18n>
            </label>
            <div class="col-sm-4">
                <input v-model="editWorkInfo.endTime" type="text" :placeholder="vc.i18n('必填，请填写结束时间','editWork')"
                    class="form-control editWorkEndTime">
            </div>
        </div>
        <div class="form-group row" v-if="editWorkInfo.workCycle == '2002'">
            <label class="col-sm-2 col-form-label text-right">
                <vc:i18n name="周期" namespace="editWork"></vc:i18n>
            </label>
            <div class="col-sm-4">
                <select class="custom-select" v-model="editWorkInfo.period">
                    <option selected disabled value="">
                        {{vc.i18n('必填，请选择任务周期','editWork')}}
                    </option>
                    <option value="2020022">月/天</option>
                    <option value="2020023">按周</option>
                </select>
            </div>
            <label class="col-sm-2 col-form-label text-right">
                <vc:i18n name="工作单" namespace="editWork"></vc:i18n>
            </label>
            <div class="col-sm-2">
                <input v-model.trim="editWorkInfo.hours" type="text" :placeholder="vc.i18n('必填，请输入小时数','editWork')"
                    class="form-control">
            </div>
            <label class="col-sm-2 col-form-label text-left">小时内完成</label>
        </div>
        <div class="form-group row " v-if="editWorkInfo.workCycle == '2002' && editWorkInfo.period == '2020022'">
            <label class="col-sm-2  text-right">
                <vc:i18n name="月" namespace="editWork"></vc:i18n>
            </label>
            <div class="col-sm-10">
                <label class="margin-left" v-for="index in 12">
                    <input type="checkbox" v-model="editWorkInfo.months" :value="index">
                    {{index}}月
                </label>
            </div>
        </div>
        <div class="form-group row  " v-if="editWorkInfo.workCycle == '2002' && editWorkInfo.period == '2020022'">
            <label class="col-sm-2  text-right">
                <vc:i18n name="日" namespace="editWork"></vc:i18n>
            </label>
            <div class="col-sm-10">
                <label class="margin-left" v-for="index in 31">
                    <input type="checkbox" v-model="editWorkInfo.days" :value="index">
                    {{index}}日
                </label>
            </div>
        </div>
        <div class="form-group row  " v-if="editWorkInfo.workCycle == '2002' && editWorkInfo.period == '2020023'">
            <label class="col-sm-2  text-right">
                <vc:i18n name="周" namespace="editWork"></vc:i18n>
            </label>
            <div class="col-sm-10">
                <label class="margin-left" v-for="index in 7">
                    <input type="checkbox" v-model.trim="editWorkInfo.workdays" :value="index">
                    {{vc.getWorkDay(index)}}
                </label>
            </div>
        </div>
        <div class="form-group row" v-for="(item,index) in editWorkInfo.contents" :key="index">
            <label class="col-sm-2 col-form-label text-right">
                内容{{index+1}}
            </label>
            <div class="col-sm-4">
                <!-- <vc:create path="common/textarea"></vc:create> -->
                <textarea class="form-control" rows="5" v-model="item.content"></textarea>
            </div>
            <div class="col-sm-2 flex align-end"  v-if="index == 0">
                <button class="btn btn-link " type="button" v-on:click="editWorkContent()">
                    添加
                </button>
            </div>
            <div class="col-sm-2 flex align-end" v-else>
                <button class="btn btn-link " type="button" v-on:click="deleteWorkContent(item)">
                    删除
                </button>
            </div>
        </div>
        <div class="ibox-content">
            <button class="btn btn-primary float-right" type="button" v-on:click="saveWorkPool()">
                <i class="fa fa-check"></i>&nbsp;提交
            </button>
            <button type="button" class="btn btn-warning float-right" style="margin-right:20px;"
                v-on:click="vc.goBack()" data-dismiss="modal">
                <i class="fa fa-close"></i>&nbsp;返回
            </button>
        </div>
    </div>

    <vc:create path="property/selectStaff"></vc:create>
</div>